import HeaderTop from "@/container/HeaderTop" // 顶部头部
import SiderLeft from "@/container/SiderLeft" // 左侧菜单
import { history } from "umi"
import { Layout, ConfigProvider } from "antd"
import zh_CN from "antd/lib/locale-provider/zh_CN"
const { Content } = Layout

// import BreadcrumbTop from '@/container/BreadcrumbTop';  //顶部面包屑

export default function IndexLayout(props: any) {
  const { location } = props
  const filterList: string[] = ["/consultationTeam/teamMember", "/consultationTeam", "/patientManagement"] // 需要过滤掉padding：15px的
  const isPadding = filterList.indexOf(location.pathname)
  // console.log('process.env.envType：', process.env.envType);
  // console.log(props)
  /* const unlisten = history.listen((location, action) => {
    console.log('路由监听：',location.pathname);
  });
  unlisten(); */

  return (
    <Layout className="indexLayout">
      {/* 下半部 */}
      <Layout>
        {/* 左侧菜单 */}
        <SiderLeft data={props} />

        {/* 中间内容区域 */}
        <Layout className="indexCenterWrap" >
          {/* 头部 */}
          <HeaderTop />

          {/* 右侧内容 */}
          <Content className={isPadding === -1 ? "indexLayout-Content" : "indexLayout-Content2"}>
            <ConfigProvider locale={zh_CN}>
              <div className="indexLayout-Props"> {props.children} </div>
            </ConfigProvider>
          </Content>

        </Layout>
      </Layout>
    </Layout>
  )
}
